package com.itstyle.seckill.topic.redis.listener;

import com.itstyle.seckill.topic.redis.common.RequestProcessorThreadPool;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;


/**
 * @Auther: liuwenxiang
 * @Date: 2020/2/23 18:00
 * @Description:
 */
@Component
public class InitListener implements  ApplicationListener<ContextRefreshedEvent>{

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        // TODO Auto-generated method stub
        if(event.getApplicationContext().getParent() != null){
            return;
        }
        RequestProcessorThreadPool.init();
    }
}
